<template>
	<view class="goods-list flex-between">
		<view class="goods-item" v-for="(item,index) in list" :key="index" @click="toPointsProduct(item)">
			<view class="poster-box">
				<image class="poster" :src="item.image" mode="aspectFill"></image>
			</view>

			<view class="info-box">
				<view class="title-box ">
					<view class="title ellipsis-2">
						{{item.title}}
					</view>
				</view>
				<!-- 	<view class="desc ellipsis-2">
					{{item.subtitle}}
				</view> -->
				<view class="price-box flex-between">
					<view class="price">
						<text class="price-val">{{item.jifen || 0}}</text>
						<text class="huobi">积分</text>
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		name: "goods",
		components: {

		},
		props: {
			list: {
				type: Array,
				default: () => {
					return [];
				}
			},
		},
		data() {
			return {
				demoList: []
			};
		},
		created() {
			this.setView();
		},
		methods: {
			setView() {

			},
			toPointsProduct(item) {
				this.toRoute({
					path: '/points-product-detail',
					query: {
						id: item.inventoryId
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.goods-list {
		flex-wrap: wrap;

		.goods-item {
			margin-bottom: 18rpx;
			width: 310rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			overflow: hidden;
			box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(0, 0, 0, 0.08);

			&:nth-child(2n) {
				margin-right: 0;
			}

			.poster-box {
				position: relative;
				width: 310rpx;
				height: 310rpx;

				image {
					width: 100%;
					height: 100%;
				}

				.addr-juli {
					bottom: 10rpx;
					left: 10rpx;
					position: absolute;
					z-index: 2;
					min-width: 104rpx;
					width: fit-content;
					height: 36rpx;
					background: rgba(0, 0, 0, 0.5);
					border-radius: 4rpx 4rpx 4rpx 4rpx;


					image {
						width: 28rpx;
						height: 28rpx;
					}

					.juli-text {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 20rpx;
						color: #FFFFFF;
					}
				}

				.flash-box {
					bottom: 10rpx;
					right: 10rpx;
					position: absolute;
					z-index: 2;

					.box-daojishi {

						.tag {
							text-align: center;
							width: 34rpx;
							height: 34rpx;
							background: #FF7979;
							border-radius: 4rpx 4rpx 4rpx 4rpx;
							font-family: DINPro, DINPro;
							font-weight: bold;
							font-size: 26rpx;
							color: #FFFFFF;
						}

						.dot-box {
							margin: 0 6rpx;

							.dot {
								width: 4rpx;
								height: 4rpx;
								background: #FF7979;

								&:nth-child(2) {
									margin-top: 6rpx;
								}
							}
						}
					}
				}


				.fav-box {
					top: 0rpx;
					left: 0rpx;
					position: absolute;
					z-index: 2;
					width: 80rpx;
					height: 80rpx;

					image {
						width: 40rpx;
						height: 40rpx;
					}
				}
			}

			.info-box {
				padding: 24rpx;

				.title-box {
					height: 70rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 600;
					font-size: 30rpx;
					color: #222222;
					line-height: 1.3;

					image {
						margin-right: 4rpx;
						width: 56rpx;
						height: 28rpx;
					}
				}

				.desc {
					margin-top: 16rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #222222;
					line-height: 1.4;
				}

				.price-box {
					margin-top: 16rpx;

					.price {
						.huobi {
							font-family: PingFang SC, PingFang SC;
							font-weight: bold;
							font-size: 28rpx;
							color: #000000;
						}

						.price-val {
							font-family: PingFang SC, PingFang SC;
							font-weight: bold;
							font-size: 28rpx;
							color: #000000;
						}
					}

					.price-line {
						margin-left: 10rpx;
						flex: 1;
						overflow: hidden;
						text-decoration: line-through;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 20rpx;
						color: #7D7D7D;
					}

					.sale {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #9695A3;
					}
				}
			}

		}
	}
</style>